import 'package:flutter/material.dart';

class Home extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Image'),
        leading: const Icon(Icons.menu),
        centerTitle: true,
        actions: const [
          Icon(Icons.settings),
        ],
      ),
      body:ImageDemo(),
    );
  }
}

class ImageDemo extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        //加载本地图片
        Image.asset(
          'images/诸葛诞.png',
          width: 200,
          height: 200,
          fit: BoxFit.cover,
        ),
        //加载网络图片
        Image.network(
          'https://patchwiki.biligame.com/images/yuan/thumb/c/cc/0ojez06ewd60tcafyczezbutrzdmouz.png/974px-%E5%88%98%E8%B1%B9-%E7%AB%8B%E7%BB%98.png',
          repeat: ImageRepeat.repeat,
          height: 200,
          colorBlendMode: BlendMode.colorDodge,
          color: Colors.green,
        ),
      ],
    );
  }
}
